Optimal. Leaf size=167 \[ \frac{(A+i B) (a+b \tan (c+d x))^n \left (\frac{b \tan (c+d x)}{a}+1\right )^{-n} F_1\left (\frac{1}{2};1,-n;\frac{3}{2};-i \tan (c+d x),-\frac{b \tan (c+d x)}{a}\right )}{d \sqrt{\cot (c+d x)}}+\frac{(A-i B) (a+b \tan (c+d x))^n \left (\frac{b \tan (c+d x)}{a}+1\right )^{-n} F_1\left (\frac{1}{2};1,-n;\frac{3}{2};i \tan (c+d x),-\frac{b \tan (c+d x)}{a}\right )}{d \sqrt{\cot (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.432217, antiderivative size = 167, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 6, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {4241, 3603, 3602, 130, 430, 429} \[ \frac{(A+i B) (a+b \tan (c+d x))^n \left (\frac{b \tan (c+d x)}{a}+1\right )^{-n} F_1\left (\frac{1}{2};1,-n;\frac{3}{2};-i \tan (c+d x),-\frac{b \tan (c+d x)}{a}\right )}{d \sqrt{\cot (c+d x)}}+\frac{(A-i B) (a+b \tan (c+d x))^n \left (\frac{b \tan (c+d x)}{a}+1\right )^{-n} F_1\left (\frac{1}{2};1,-n;\frac{3}{2};i \tan (c+d x),-\frac{b \tan (c+d x)}{a}\right )}{d \sqrt{\cot (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4241
Rule 3603
Rule 3602
Rule 130
Rule 430
Rule 429
Rubi steps
\begin{align*} \int \sqrt{\cot (c+d x)} (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=\left (\sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(a+b \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt{\tan (c+d x)}} \, dx\\ &=\frac{1}{2} \left ((A-i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(1+i \tan (c+d x)) (a+b \tan (c+d x))^n}{\sqrt{\tan (c+d x)}} \, dx+\frac{1}{2} \left ((A+i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(1-i \tan (c+d x)) (a+b \tan (c+d x))^n}{\sqrt{\tan (c+d x)}} \, dx\\ &=\frac{\left ((A-i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{(a+b x)^n}{(1-i x) \sqrt{x}} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac{\left ((A+i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{(a+b x)^n}{(1+i x) \sqrt{x}} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac{\left ((A-i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^n}{1-i x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}+\frac{\left ((A+i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^n}{1+i x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}\\ &=\frac{\left ((A-i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)} (a+b \tan (c+d x))^n \left (1+\frac{b \tan (c+d x)}{a}\right )^{-n}\right ) \operatorname{Subst}\left (\int \frac{\left (1+\frac{b x^2}{a}\right )^n}{1-i x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}+\frac{\left ((A+i B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)} (a+b \tan (c+d x))^n \left (1+\frac{b \tan (c+d x)}{a}\right )^{-n}\right ) \operatorname{Subst}\left (\int \frac{\left (1+\frac{b x^2}{a}\right )^n}{1+i x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}\\ &=\frac{(A+i B) F_1\left (\frac{1}{2};1,-n;\frac{3}{2};-i \tan (c+d x),-\frac{b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^n \left (1+\frac{b \tan (c+d x)}{a}\right )^{-n}}{d \sqrt{\cot (c+d x)}}+\frac{(A-i B) F_1\left (\frac{1}{2};1,-n;\frac{3}{2};i \tan (c+d x),-\frac{b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^n \left (1+\frac{b \tan (c+d x)}{a}\right )^{-n}}{d \sqrt{\cot (c+d x)}}\\ \end{align*}
Mathematica [F] time = 9.53169, size = 0, normalized size = 0. \[ \int \sqrt{\cot (c+d x)} (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.419, size = 0, normalized size = 0. \begin{align*} \int \sqrt{\cot \left ( dx+c \right ) } \left ( a+b\tan \left ( dx+c \right ) \right ) ^{n} \left ( A+B\tan \left ( dx+c \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sqrt{\cot \left (d x + c\right )}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (B \tan \left (d x + c\right ) + A\right )}{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sqrt{\cot \left (d x + c\right )}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sqrt{\cot \left (d x + c\right )}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]